#include once "mud-gui/ui.bi"
#include once "mud-gui/widgets/GridLayout.bi"
#include once "mud-gui/widgets/PushButton.bi"

using ui

SLOT(button_click1)
	ConsolePrint("in button_click1" )
	return 1
ENDSLOT

SLOT(button_click2)
	ConsolePrint("in button_click2" )
	return 1
ENDSLOT

dim as GridLayout ptr mw
dim as PushButton ptr pb

if initScreen("PushButton Example") = 0 then
	print "unable to initialize screen."
	end 23
end If

var checkimg = imagecreate(20,20)
bload exepath & "/check.bmp", checkimg

mw = new GridLayout
pb = new PushButton
pb->setPixmap = checkimg

connectSignal( pb, clicked, button_click1 )
'              ^   ^        ^
'              |   |        + The SLOT to call when this signal is triggered.
'              |   + The signal you wish to catch.
'              + The object whose signal you want to catch.
connectSignal( pb, clicked, button_click2 )

mw->sizeGrid(5,5)
ConsolePrint( "1: " & mw->placeWidget( toBaseWidget(pb), 3,3 ) )

end runGUI(toBaseWidget(mw))
